//
//  InfinitelyScrollingView.h
//  TRoad2
//
//  Created by ZhangYanhua on 14/11/13.
//  Copyright (c) 2014年 Mach. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "LeftPagingFlowCollectionLayout.h"

@protocol LeftInfinitelyScrollingViewDelegate <NSObject>

- (UICollectionViewCell *)collectionView:(UICollectionView *)cv
                  cellForItemAtIndexPath:(NSIndexPath *)indexPath
                                withItem:(id)item;

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndex:(NSInteger)index;

@end

@interface LeftInfinitelyScrollingView : UIView <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>

@property (nonatomic, weak) id<LeftInfinitelyScrollingViewDelegate>delegate;

@property (nonatomic, strong) NSArray *itemArray;
@property (nonatomic, assign) NSInteger currentIndex;

@property (nonatomic, strong) UICollectionViewFlowLayout *collectionViewLayout;
@property (nonatomic, strong) UICollectionView *collectionView;

- (id)initWithFrame:(CGRect)aFrame ItemArray:(NSArray *)itemArray;

@end
